﻿using Infrastructure.Filters;
using Microsoft.AspNetCore.Mvc;
using System.Reflection;
using System.Web;
using ZR.Infrastructure;
using ZR.Model;
using ZR.Model.BaseFrame.Dto;
using ZR.Service.BaseFrame.IService;
using ZR.Service.IService;
using ZR.ServiceCore.Attributes;

namespace ZR.Admin.WebApi.Controllers
{
    /// <summary>
    /// 工具
    /// </summary>
    [Route("[controller]/[action]")]
    [ApiController]
    [EnableRspContract]
    public class ToolController : ApiControllerBase
    {
        private readonly IToolService _toolService;
        public ToolController(IToolService toolService)
        {
            this._toolService = toolService;
        }

        /// <summary>
        /// 获取代码模块树列表
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [AllowAnonymous]
        public async Task<List<CodeModuleTreeNodeInfo>> GetCodeModuleTreeList([FromBody]GetCodeModuleTreeListReq req)
        {
            var list=await this._toolService.GetCodeModuleTreeList(req);
            return list;
        }
    }

    public class FuncModuleInfoDto
    {
        /// <summary>
        /// 模块编码
        /// </summary>
        public string ModuleCode { get; set; }

        /// <summary>
        /// 模块名
        /// </summary>
        public string ModuleName { get; set; }
    }
}
